home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************
- ADOBE SYSTEMS INCORPORATED
- Copyright 2002 Adobe Systems Incorporated
- All Rights Reserved
-
- NOTICE: Adobe permits you to use, modify, and distribute this
- file in accordance with the terms of the Adobe license agreement
- accompanying it. If you have received this file from a source
- other than Adobe, then your use, modification, or distribution
- of it requires the prior written permission of Adobe.
- ***************************************************************/
- /***************************************************************
- Author: Mary Obelnicki
- ***************************************************************/
-
- /***************************************************************
-
- The following script creates a key frame animation effect on
- the currently selected objects.
-
- Function:
- materalize(letters, frames, stagger, opacity, rotation, xdiff, ydiff, scale, forward, startNow)
-
- Arguments:
- <letters> LMObject - an array of the objects to apply the
- effect. Does not have to be text objects. It can be
- any LMObject.
- <frames> integer - the length of the animation for each
- object
- <stagger> integer - the number of frames to stagger the
- start of each animation
- <opacity> integer - the opacity to end at
- <rotation> integer - the rotation to end at
- <xdiff>, <ydiff> integer - the x, y difference from the
- initial position to end at. In screen coords.
- <scale> integer - scale of original size to end at.
- 1=same size, 2=double size
- <forward> boolean - stagger from first character or
- last character
- <startNow> boolean - should the animation start now, at
- the current frame, or end now.
-
- ***************************************************************
- To change the behavior of this script, make your changes below
- ***************************************************************/
-
- var objects = application.currentComposition.selection;
-
- materalize(objects,12, 2, 0, 0, 0, 0, 3, true, true);
-
- /***************************************************************
- DO NOT EDIT BELOW THIS LINE
- ***************************************************************/
-
-
-
- function materalize(letters, frames, stagger, opacity, rotation, xdiff, ydiff, scale, forward, startNow)
- {
- if(letters.length < 1)
- return;
- //the first frame of the animation
- var frame0;
- if (startNow)
- frame0 = letters[0].currentFrame;
- else
- frame0 = letters[0].currentFrame - (stagger * (letters.length - 1) + frames);
-
- for (i=0; i < letters.length; i++)
- {
- var cl; // the current letter
- if (forward)
- cl = letters[i];
- else
- cl = letters[letters.length -1 -i];
-
- //the original values
- var xo = cl.position.x;
- var yo = cl.position.y;
- var oriOpacity = cl.opacity;
- var oriRotation = cl.rotation;
- var oriScalex = cl.scale.x;
- var oriScaley = cl.scale.y;
-
- //turn on relevant stopwatches
-
- if (opacity != oriOpacity)
- cl.stopwatch.opacity = true;
- if (rotation != oriRotation)
- cl.stopwatch.rotation = true;
- if (scale !=1)
- cl.stopwatch.scale = true;
-
- if((xdiff != 0) || (ydiff != 0))
- cl.stopwatch.position = true;
-
- //first frame
- cl.currentFrame = frame0 + (i * stagger);
- cl.position.x = xo + xdiff;
- cl.position.y = yo + ydiff;
- cl.opacity = opacity;
- cl.rotation = rotation;
- cl.scale.x = oriScalex * scale;
- cl.scale.y = oriScaley * scale;
-
- //last frame
- cl.currentFrame = frame0 + frames + (i * stagger);
- cl.position.x = xo;
- cl.position.y = yo;
- cl.scale.x = oriScalex;
- cl.scale.y = oriScaley;
- cl.opacity = oriOpacity;
- cl.rotation = oriRotation;
- }
- }
-
-